package leetcode.code567.PermutationinString;

import leetcode.helper.HelpDebug;

public abstract class PermutationinString implements IPermutationinString {

	@Override
	public void debug1() {
		// 输入：s1 = "ab" s2 = "eidbaooo"
		// 输出：true
		// 解释：s2 包含 s1 的排列之一 ("ba").
		String s1 = "ab";
		String s2 = "eidbaooo";
		boolean expect = true;
		HelpDebug.printInputs(String.valueOf(expect), s1, s2);
		boolean result = this.debug(s1, s2);
		System.out.println("match " + (result == expect));
	}

	@Override
	public void debug2() {
		// 输入：s1= "ab" s2 = "eidboaoo"
		// 输出：false
		String s1 = "ab";
		String s2 = "eidboaoo";
		boolean expect = false;
		HelpDebug.printInputs(String.valueOf(expect), s1, s2);
		boolean result = this.debug(s1, s2);
		System.out.println("match " + (result == expect));
	}

	@Override
	public void debug3() {
		// 输入：s1= "adc" s2 = "dcda"
		// 输出：true
		// l上的太快，可能性丢掉了
		String s1 = "adc";
		String s2 = "dcda";
		boolean expect = true;
		HelpDebug.printInputs(String.valueOf(expect), s1, s2);
		boolean result = this.debug(s1, s2);
		System.out.println("match " + (result == expect));
	}

	@Override
	public void debug4() {
		String s1 = "abcdxabcde";
		String s2 = "abcdeabcdx";
		boolean expect = true;
		HelpDebug.printInputs(String.valueOf(expect), s1, s2);
		boolean result = this.debug(s1, s2);
		System.out.println("match " + (result == expect));
	}

	@Override
	abstract public boolean checkInclusion(String s1, String s2);

	@Override
	public boolean debug(String s1, String s2) {
		boolean result = this.checkInclusion(s1, s2);
		System.out.println(result);
		return result;
	}

}
